package org.ht.entity;

import org.ht.config.ConstField;
import org.ht.config.ImageType;

public class Case extends AbstractEntity {

	public Case() {
		super();
		children.add(new BasicInfo());
		children.add(new OperationBefore());
		children.add(new OperationMiddle());
		children.add(new OperationAfter());
	}

	public BasicInfo getBasicInfo() {
		return (BasicInfo) children.get(0);
	}

	public OperationBefore getOperationBefore() {
		// 术前表中应该要有病员号这个信息，但是界面上没有体现，所以强加
		OperationBefore tmp = (OperationBefore) children.get(1);
		tmp.property.put(ImageType.PID,
				getBasicInfo().property.get(ImageType.PID));
		return tmp;
	}

	public OperationMiddle getOperationMiddle() {
		// 术中表中应该要有病员号这个信息，但是界面上没有体现，所以强加
		OperationMiddle tmp = (OperationMiddle) children.get(2);
		tmp.property.put(ImageType.PID,
				getBasicInfo().property.get(ImageType.PID));

		return tmp;
	}

	public OperationAfter getOperationAfter() {
		return (OperationAfter) children.get(3);
	}

	public String getPid() {
		String pid = getProperty().get(ConstField.PID);
		if (pid == null)
			pid = "";
		return pid;
	}
}
